$(window).load(function(){
  $('#m_footer_ctn').height($(document).height() - ($('#header').height() + $('#m_head_ctn').height() + $('#main_ctn').height() + $('#footer').height()) + 'px');
  $('#m_g_footer_ctn').height($(document).height() - ($('#header').height() + $('#m_head_ctn').height() + $('#main_ctn').height() + $('#footer').height()) + 'px');
});

$(window).resize(function(){

  $('#m_footer_ctn').height($(document).height() - ($('#header').height() + $('#m_head_ctn').height() + $('#main_ctn').height() + $('#footer').height()) + 'px');
});